namespace _1_31_2015_SLMSite.Data.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class addedApptTimeFrame : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.ApptTimeFrames",
                c => new
                    {
                        ApptTimeFrameId = c.Int(nullable: false, identity: true),
                        ApptTimeFrameDesc = c.String(nullable: false),
                    })
                .PrimaryKey(t => t.ApptTimeFrameId);
            
            AddColumn("dbo.Appointments", "AppTimeFrameId", c => c.Int(nullable: false));
            CreateIndex("dbo.Appointments", "AppTimeFrameId");
            AddForeignKey("dbo.Appointments", "AppTimeFrameId", "dbo.ApptTimeFrames", "ApptTimeFrameId", cascadeDelete: true);
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.Appointments", "AppTimeFrameId", "dbo.ApptTimeFrames");
            DropIndex("dbo.Appointments", new[] { "AppTimeFrameId" });
            DropColumn("dbo.Appointments", "AppTimeFrameId");
            DropTable("dbo.ApptTimeFrames");
        }
    }
}
